package com.yjy.pay.check;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yjy.pay.content.PayConent;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

@Component
public class OutTxNoChecker implements AbstractChecker {

    public boolean check(PayConent payConent) {
        JSONObject bizContent = (JSONObject) JSON.toJSON(payConent.getBizContent());
        String orderNo = bizContent.getString("outTxNo");
        if (StringUtils.isEmpty(orderNo)) {
            throw new RuntimeException("订单号不能为空！");
        }

        return true;
    }
}